home *** CD-ROM | disk | FTP | other *** search
- // By Judy D. Halchin, Educational Computing Services, Allegheny College.
- // You may freely copy, distribute and reuse this code.
- // Allegheny College and the author disclaim any warranty of any kind,
- // expressed or implied, as to its fitness for any particular use.
- // This work was partially supported by a Teacher Preparation grant from the
- // National Science Foundation.
-
- #import <appkit/View.h>
-
- #define HORIZONTAL 0 // values for orientation
- #define VERTICAL 1
-
- #define ABOVERIGHT 0 // values for labelPosition
- #define BELOWLEFT 1
-
- @interface NumberLine:View
- {
- int orientation, labelPosition;
- BOOL endBars;
- float linePosition;
- float backgroundGray, lineGray, labelGray, borderWidth;
- struct _tickInfo
- {
- float firstTick;
- float tickSpacing;
- int numberOfTicks;
- float firstLabel;
- float labelSpacing;
- int numberOfLabels;
- char labelString[11][30];
- char expString[11][5];
- BOOL scientific;
- } tickInfo;
- id numberLineNXImage;
- }
-
- - initFrame:(NXRect *)frameRect;
- - drawSelf:(const NXRect *)rects :(int)rectCount;
- - drawIntoImage;
-
- - numberLineNXImage;
-
- - (float)max;
- - (float)min;
- - setMin:(float)newMin max:(float)newMax;
- - zoomIn:(float)multiplier;
- - zoomOut:(float)multiplier;
-
- - (float)center;
- - setCenter:(float)newCenter;
- - slide:(float)translation;
-
- - (float)linePosition;
- - setLinePosition:(float)newPostion;
-
- - setBackgroundGray:(float)gray;
- - setLineGray:(float)gray;
- - setLabelGray:(float)gray;
- - (float)backgroundGray;
- - (float)lineGray;
- - (float)labelGray;
-
- - (int)orientation;
-
- - (int)labelPosition;
- - setLabelPosition:(int)newPosition;
-
- - setBordered:(BOOL)shouldHaveBorder width:(float)width;
- - (BOOL)bordered;
- - setEndBars:(BOOL)shouldHaveEndBars;
- - (BOOL)hasEndBars;
-
- - calculateTicks;
-
- - setFrame:(const NXRect *)frameRect;
-
- - read:(NXTypedStream *)typedStream;
- - write:(NXTypedStream *)typedStream;
- - awake;
- - (const char*)inspectorName;
-
- @end
-